package Class_03_01;

import java.util.Scanner;

public class homework1 {
    public static void main(String[] args) {
        //计算整型各个位数上的数字和
        Scanner sc =new Scanner(System.in);
        int num = sc.nextInt();
        int temp = num;
        int sum = 0;
        int flag = 0;
        while(temp != 0)
        {
            temp /= 10;
            flag++;
        }
        while(flag != 0)
        {
            sum += num % 10;
            num /= 10;
            flag--;
        }
        System.out.println("各位数数字之和" + sum);
    }
}
